package com.your.package.network

import retrofit2.Response
import retrofit2.http.POST
import retrofit2.http.Query

interface ApiService {
    @POST("user/getToken.json")
    suspend fun getRongCloudToken(
        @Query("userId") userId: String,
        @Query("name") name: String
    ): Response<RongCloudTokenResponse>

    @POST("user/info.json")
    suspend fun getRongCloudUserInfo(
        @Query("userId") userId: String
    ): Response<RongCloudUserInfo>

    @POST("send-code")
    suspend fun sendVerificationCode(
        @Query("email") email: String
    ): Response<Unit>

    @POST("verify-code")
    suspend fun verifyCode(
        @Query("email") email: String,
        @Query("code") code: String
    ): Response<Boolean>
}

data class RongCloudTokenResponse(
    val code: Int,
    val userId: String,
    val token: String?
)

data class RongCloudUserInfo(
    val code: Int,
    val userName: String,
    val userPortrait: String?,
    val createTime: String
) 